package com.user.controller;

import com.user.model.vo.MessageVo;
import com.user.param.Result;
import com.user.service.MessageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@Api(value = "信息接口")
@RestController
@RequestMapping(value = "/msg")
public class MessageController {

    @Autowired
    MessageService messageService;

    @ApiOperation(value = "发送信息")
    @RequestMapping(value = "/putMessage",method = RequestMethod.POST)
    public Result putMessage(@RequestBody MessageVo messageVo){
        return messageService.putMessage(messageVo);
    }


    @ApiOperation(value = "发送信息")
    @RequestMapping(value = "/getMessageList",method = RequestMethod.POST)
    public Result getMessageList(String token){
        return messageService.getMessageList(token);
    }

}
